﻿<UserControl x:Class="Mnk.TBox.Plugins.Templates.Settings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.Templates.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WPFControls"
             xmlns:Models="clr-namespace:Mnk.Library.Common.UI.Model;assembly=Mnk.Library.Common"
             xmlns:wpfSyntaxHighlighter="clr-namespace:Mnk.Library.WpfSyntaxHighlighter;assembly=Mnk.Library.WPFSyntaxHighlighter"
             xmlns:captioned1="clr-namespace:Mnk.Library.WpfControls.Components.Captioned;assembly=Mnk.Library.WPFControls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="400">
    <TabControl>
        <TabItem Header="{loc:Tr FilesAndFoldersTemplatesSettings}">
            <DockPanel>
                <captioned1:CaptionedTextBox Value="{Binding ItemTemplate}" Caption="{loc:Tr ItemNameTemplate}" DockPanel.Dock="Top" Margin="5"/>
                <Label Content="{loc:Tr KnownValuesToUseOnRunByDefault}" DockPanel.Dock="Top" Padding="5,5,5,0"/>
                <Units:ListBoxUnit ItemsSource="{Binding KnownValues}" UnitType="Text" Title="{loc:Tr ConfigureKnownValues}">
                    <Units:ListBoxUnit.ItemTemplate>
                        <DataTemplate DataType="Models:PairData">
                            <StackPanel Margin="0,5">
                                <TextBlock Text="{Binding Key}" Padding="0" FontWeight="Bold" TextTrimming="CharacterEllipsis"/>
                                <TextBox Text="{Binding Value}" Padding="0" />
                            </StackPanel>
                        </DataTemplate>
                    </Units:ListBoxUnit.ItemTemplate>
                </Units:ListBoxUnit>
            </DockPanel>
        </TabItem>
        <TabItem Header="{loc:Tr StringTemplatesSettings}">
            <DockPanel>
                <Units:ComboBoxUnit Name="StringTemplates" ItemsSource="{Binding StringTemplates}" Title="{loc:Tr StringTemplates}" UnitType="ComboBox" DockPanel.Dock="Top" />
                <wpfSyntaxHighlighter:SyntaxHighlighter DataContext="{Binding ElementName=StringTemplates, Path=SelectedValue}" Text="{Binding Value}" IsEnabled="{Binding ElementName=StringTemplates, Path=IsSelected}"/>
            </DockPanel>
        </TabItem>
    </TabControl>
</UserControl>
